package com.itheim.neibulei2;

public class Test {

    public static void main(String[] args) {
        Outer outer = new Outer();
        outer.setI(30);
        System.out.println(outer.getI());
        outer.useSing();
        outer.useInner();

    }
}

class Outer {
    private int i = 10;

    public int getI() {
        return i;
    }

    public void setI(int i) {
        this.i = i;
    }

    private void sing() {
        System.out.println("sing");
    }

    public void useSing() {
        sing();
    }

    private class Inner {
        int j = 20;

        public void dance() {
            System.out.println("dance");
        }
    }

    public void useInner() {
        Inner inner = new Inner();
        System.out.println(inner.j);
        inner.dance();
    }
}

